<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head th:replace="_fragment :: head(~{::title})">
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
     <!-- 兼容移动端和PC端 -->
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <link rel="stylesheet" th:href="@{css/semantic-UI/semantic.min.css}">
    <link rel="stylesheet" th:href="@{css/me.css}">
    <title>首页</title>
</head>
<body>
    <!-- 导航 -->
    <!-- inverted 反转   attached 没有圆角 -->
    <nav th:replace="_fragment :: menu(1)" class="ui inverted attached segment m-padded-tb-mini m-shadow-small">
        <div class="ui container">
            <!-- stackable屏幕下的时候可堆叠的 适应手机端 -->
            <div class="ui inverted secondary stackable menu">
                <h2 class="ui teal header item">陈楷的Blog</h2>
                <!-- 标签加了mini之后   火狐正常显示 edge错位显示  所以加上small -->
                <a href="#" class="item m-item m-mobile-hide"><i class="small home icon"></i>首页</a>
                <a href="#" class="item m-item m-mobile-hide"><i class="small idea icon"></i>分类</a>
                <a href="#" class="item m-item m-mobile-hide"><i class="small tags icon"></i>标签</a>
                <a href="#" class="item m-item m-mobile-hide"><i class="small clone icon"></i>归档</a>
                <a href="#" class="item m-item m-mobile-hide"><i class="small info icon"></i>关于我</a>
                <div class="right m-item item m-mobile-hide">
                    <!-- transparent 颜色灰色 -->
                    <div class="ui icon inverted transparent input ">
                        <input type="text" placeholder="Search....">
                        <i class="search link icon"></i>
                    </div>
                </div>
            </div>
        </div>
        <a href="#" class="ui menu toggle black icon button m-top-right m-mobile-show">
            <i class="sidebar icon"></i>
        </a>
    </nav>
    

    <!-- 中间容器 -->
    <div class="m-padded-tb-big m-container animated lightSpeedIn">
        <div class="ui container">

            <div class="ui stackable grid">

                <!-- 中间博客列表部分 -->
                <div class="eleven wide column">
                    <!-- header头部 -->
                    <div class="ui top attached segment">
                        <div class="ui middle aligned two column grid">
                            <div class="column">
                                <h3 class="ui teal header">博客</h3>
                            </div>
                            <div class="right aligned column">
                                共 <h2 class="ui orange header m-inline-blok m-text-thin" th:text="${page.totalElements}">
                                14</h2>篇
                            </div>
                        </div>
                    </div>

                    <!-- 中间内容部分  attached两个连在一块-->
                    <div class="ui attached segment">
                        
                        <div class="ui padded vertical segment m-padded-tb-large" th:each="blog : ${page.content}">
                            <!-- 手机端反转 reversed stackable -->
                            <div class="ui stackable mobile reversed grid middle aligned">
                                <div class="eleven wide column">
                                    <h3 class="ui header"><a href=""  th:text="${blog.title}" th:href="@{/blog/{id}(id=${blog.id})}">你真的理解财富自由吗？</a></h3>
                                    <p th:text="|${blog.description}...|">正确做好任何一件事情的前提是清晰、正确的理解目标。
                                        而事实是，我们和多人很多时候根本没有对目标正确的定义，甚至.......</p>
                                    <div class="ui grid">
                                        <div class="eleven wide column">
                                            <div class="ui mini horizontal link list">
                                                <div class="item">
                                                    <img th:src="@{${blog.user.avatar}}" src="https://unsplash.it/100/100?image=1005" alt="" class="ui avatar image">
                                                    <div class="content"><a th:text="${blog.user.Nickname}" href="#" th:href="@{/about}" target="_blank" class="header">陈楷楷</a></div>
                                                </div>
                                                <div class="item">
                                                    <!--格式化时间-->
                                                    <i class="calendar icon"></i><span th:text="${#dates.format(blog.updateTime,'yyyy-MM-dd')}">2022-06-01</span>
                                                </div>
                                                <div class="item">
                                                    <i class="eye icon"></i>
                                                    <span th:text="${blog.views}">190</span>
                                                </div>
                                            </div>
                                        </div>
                                        <div class="right aligned five wide column">
                                            <a href="#" th:href="@{/types/{id}(id=${blog.type.id})}" target="_blank" class="ui teal basic label m-padded-tiny m-text-thin" th:text="${blog.type.name}">认知神级</a>
                                        </div>
                                    </div>
                                </div>
                                
                                <div class="five wide column">
                                    <a href="#"  target="_blank" th:href="@{/blog/{id}(id=${blog.id})}">
                                        <img th:src="@{${blog.firstPicture}}" src="https://unsplash.it/800/500?image=1005"
                                             alt="" class="ui rounded image">
                                    </a>
                                </div>
                            </div>
                        </div>
                    </div>

                    <!-- 底部 -->
                    <div th:if="${page.totalPages} > 1" class="ui buttom attached segment">
                        <div class="ui middle aligned two column grid">
                            <div class="column">
                                <a href="" th:href="@{/(page=${page.number}-1)}" th:unless="${page.first}" class="ui teal button basic min">上一页</a>
                            </div>
                            <div class="right aligned column">
                                <a href="" th:href="@{/(page=${page.number}+1)}" th:unless="${page.last}" class="ui teal button basic min">下一页</a>
                            </div>
                        </div>
                    </div>
                </div>

                <!-- 中间左边的小卡片 -->
                <div class="five wide column">

                <!-- 分类 -->
                <div class="ui segments">
                    <div class="ui secondary segment">
                        <div class="ui two column grid">
                            <div class="column">
                                <i class="idea icon"></i>分类
                            </div>
                            <div class="right aligned column">
                                <a href="#" target="_blank" th:href="@{/types/-1}">more</a><i class="angle double right icon"></i>
                            </div>
                        </div>
                    </div>
                    <div class="ui teal segment">
                        <div class="ui fluid vertical menu">
                            <a th:href="@{/types/{id}(id=${type.id})}" href="#" target="_blank" class="item" th:each="type :${types}">
                                <span th:text="${type.name}">学习日志</span>
                                <div class="ui teal basic left pointing label" th:text="${#arrays.length(type.blogs)}">13</div>
                            </a>
                        </div>
                    </div>
                </div>

                <!-- 标签 -->
                <div class="ui segments m-margin-top-large">
                    <div class="ui secondary segment">
                        <div class="ui two column grid">
                            <div class="column">
                                <i class="idea icon"></i>标签
                            </div>
                            <div class="right aligned column">
                                <a href="#" target="_blank" th:href="@{/tags/-1}">more</a><i class="angle double right icon"></i>
                            </div>
                        </div>
                    </div>
                    <div class="ui teal segment">
                        <a href="#" target="_blank" class="ui teal basic left pointing label m-margin-tb-tiny" th:each="tag : ${tags}">
                             <span th:text="${tag.name}">方法论</span>
                             <div class="detail" th:text="${#arrays.length(tag.blogs)}">76</div>
                        </a>
                    </div>
                </div>

                <!-- 最新推荐 -->
                <div class="ui segments m-margin-top-large">
                    <div class="ui secondary segment">
                        <i class="bookmark icon"></i>最新推荐
                    </div>
                    <div class="ui segment" th:each="recomblog : ${recommendBlog}">
                        <a href="#" th:href="@{/blog/{id}(id=${recomblog.id})}" target="_blank"  th:text="${recomblog.title}" class="m-black m-text-thin">用户故事（User Story）</a>
                    </div>
                </div>

                <!-- 二维码 -->
                <h4 class="ui horizontal divider header">扫码关注我</h4>
                <div class="ui centered card" style="width: 11em">
                    <img th:src="@{image/WeChat.jpg}" alt="" class="ui rounded image">
                </div>

                </div>

            </div>

        </div>
    </div>


    <!-- 底部footer -->
    <footer th:replace="_fragment::footer" class="ui  inverted blue vertical segment m-footer-padding-tb-massive">
        <div class="ui center aligned container   ">
            <div class="ui inverted divided stackable grid">
                <!--二维码-->
                <div class="three wide column">
                    <div class="ui inverted link list">
                        <div class="item">
                            <img th:src="@{/image/WeChat.jpg}" class="ui rounded image"
                                 style="width: 110px" alt=""/>
                        </div>
                    </div>
                </div>
                <!--文字-->
                <div class="three wide column">
                    <h4 class="ui inverted header m-text-thin m-text-spaced m-opacity-mini">最新博客</h4>
<!--                    <div class="ui inverted link list" th:each="recomblog : ${recommendBlog}">-->
<!--                        <a href="#" th:href="@{/blog/{id}(id=${recomblog.id})}" class="item" th:text="${recomblog.title}">用户故事</a>-->
<!--                    </div>-->
                </div>
                <div class="three wide column">
                    <h4 class="ui inverted header m-text-thin m-text-spaced ">联系我</h4>
                    <div class="ui inverted link list">
                        <a href="#" class="item">Emall:1240863484@qq.com</a>
                        <a href="#" class="item">QQ:1240863484</a>
                    </div>
                </div>
                <div class="seven wide column">
                    <h4 class="ui inverted header m-text-thin m-text-spaced ">博客简介</h4>
                    <p class="m-text-thin m-text-spaced  m-opacity-mini">
                        这是我的个人博客、会分享关于编程、写作、思考相关的任何内容、希望可以给来到这儿的人有所帮助...
                    </p>
                </div>
            </div>
            <div class="ui inverted section divider">
                <br>
                <br>
                <p class="m-text-thin m-text-spaced m-opacity-tiny">
                    Copyright © 2022 - 06 - 01 Lirenmi Designed by Lirenmi
                </p>
            </div>
        </div>
    </footer>



    <!--    引入js文件  下面的在静态html页面下面为注释， 到了thymleaf下就是引入js页面-->
    <!--/*/<th:block th:replace="_fragment :: script">/*/-->
<script th:src="@{js/Jquery.js}"></script>
<script th:src="@{css/semantic-UI/semantic.min.js}"></script>
    <!--/*/</th:block>/*/-->
    <!--雪花特效-->
<script th:src="@{http://www.lmlblog.com/winter/templets/xq/js/snowy.js}"></script>
<script th:src="@{http://www.lmlblog.com/blog/14/js/Snow.js}"></script>
<style type="text/css">
    .snow-container{position:fixed;top:0;left:0;width:100%;height:100%;pointer-events:none;z-index:100001;}
</style>
<div class="snow-container"></div>
    <!---->

<script>
$('.menu.toggle').click(function(){
    //点击这个按钮去除css中的m-mobile-hide样式
    $('.m-item').toggleClass('m-mobile-hide');
})
</script>
</body>
</html>